import configparser
import os

path = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "config/settings.ini")
def read_ini():
    config = configparser.ConfigParser()#实例化configparser
    config.read(path,encoding='utf-8')#通过configparser以utf-8编码的方式读取settings.ini
    return config

get_ini = read_ini()
#取settings.ini里的数据，方式如下
#print(read_ini()['host']['api_sit_url'])